#!/bin/sh

if [ $# -ne 1 ]; then

	echo "Usage: $0 file.md"
	exit
fi

grep "^#### " $1
grep "^### " $1
grep "^## " $1
grep "^# " $1

awk -F\*  '{

	if (NF>1) {
		for (counter = 2; counter < NF+1; counter =counter+2) {
			if (length($counter)<1) {
				counter ++; 
				print $counter
				counter ++;
			} else {
				print $counter
			}
		}
	} else {
		if (substr($1,1,2) == ">> ") print "<span style=\"color:green;\">小宝说：<\/span>"substr($1,3,length($1))
	}
}'  $1

